package pe.com.slcsccy.aegis.model.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import pe.com.slcsccy.aegis.model.beans.TipoServicio;
import pe.com.slcsccy.aegis.model.beans.TipoServicioExample;

import com.ibatis.sqlmap.client.SqlMapClient;


@Repository("tipoServicioDAO")
public class TipoServicioDAOImpl extends SqlMapClientDaoSupport implements TipoServicioDAO {

    /**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tipo_servicio
	 * @ibatorgenerated  Sat May 19 03:00:51 COT 2012
	 */
	public TipoServicioDAOImpl() {
		super();
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tipo_servicio
	 * @ibatorgenerated  Sat May 19 03:00:51 COT 2012
	 */
	public int countByExample(TipoServicioExample example) {
		Integer count = (Integer) getSqlMapClientTemplate().queryForObject(
				"tipo_servicio.ibatorgenerated_countByExample", example);
		return count;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tipo_servicio
	 * @ibatorgenerated  Sat May 19 03:00:51 COT 2012
	 */
	public int deleteByExample(TipoServicioExample example) {
		int rows = getSqlMapClientTemplate().delete(
				"tipo_servicio.ibatorgenerated_deleteByExample", example);
		return rows;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tipo_servicio
	 * @ibatorgenerated  Sat May 19 03:00:51 COT 2012
	 */
	public int deleteByPrimaryKey(Long idTipoServicio) {
		TipoServicio key = new TipoServicio();
		key.setIdTipoServicio(idTipoServicio);
		int rows = getSqlMapClientTemplate().delete(
				"tipo_servicio.ibatorgenerated_deleteByPrimaryKey", key);
		return rows;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tipo_servicio
	 * @ibatorgenerated  Sat May 19 03:00:51 COT 2012
	 */
	public void insert(TipoServicio record) {
		getSqlMapClientTemplate().insert(
				"tipo_servicio.ibatorgenerated_insert", record);
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tipo_servicio
	 * @ibatorgenerated  Sat May 19 03:00:51 COT 2012
	 */
	public void insertSelective(TipoServicio record) {
		getSqlMapClientTemplate().insert(
				"tipo_servicio.ibatorgenerated_insertSelective", record);
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tipo_servicio
	 * @ibatorgenerated  Sat May 19 03:00:51 COT 2012
	 */
	@SuppressWarnings("unchecked")
	public List<TipoServicio> selectByExample(TipoServicioExample example) {
		List<TipoServicio> list = getSqlMapClientTemplate().queryForList(
				"tipo_servicio.ibatorgenerated_selectByExample", example);
		return list;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tipo_servicio
	 * @ibatorgenerated  Sat May 19 03:00:51 COT 2012
	 */
	public TipoServicio selectByPrimaryKey(Long idTipoServicio) {
		TipoServicio key = new TipoServicio();
		key.setIdTipoServicio(idTipoServicio);
		TipoServicio record = (TipoServicio) getSqlMapClientTemplate()
				.queryForObject(
						"tipo_servicio.ibatorgenerated_selectByPrimaryKey", key);
		return record;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tipo_servicio
	 * @ibatorgenerated  Sat May 19 03:00:51 COT 2012
	 */
	public int updateByExampleSelective(TipoServicio record,
			TipoServicioExample example) {
		UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
		int rows = getSqlMapClientTemplate()
				.update("tipo_servicio.ibatorgenerated_updateByExampleSelective",
						parms);
		return rows;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tipo_servicio
	 * @ibatorgenerated  Sat May 19 03:00:51 COT 2012
	 */
	public int updateByExample(TipoServicio record, TipoServicioExample example) {
		UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
		int rows = getSqlMapClientTemplate().update(
				"tipo_servicio.ibatorgenerated_updateByExample", parms);
		return rows;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tipo_servicio
	 * @ibatorgenerated  Sat May 19 03:00:51 COT 2012
	 */
	public int updateByPrimaryKeySelective(TipoServicio record) {
		int rows = getSqlMapClientTemplate().update(
				"tipo_servicio.ibatorgenerated_updateByPrimaryKeySelective",
				record);
		return rows;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table tipo_servicio
	 * @ibatorgenerated  Sat May 19 03:00:51 COT 2012
	 */
	public int updateByPrimaryKey(TipoServicio record) {
		int rows = getSqlMapClientTemplate().update(
				"tipo_servicio.ibatorgenerated_updateByPrimaryKey", record);
		return rows;
	}

	/**
	 * This class was generated by Apache iBATIS ibator. This class corresponds to the database table tipo_servicio
	 * @ibatorgenerated  Sat May 19 03:00:51 COT 2012
	 */
	private static class UpdateByExampleParms extends TipoServicioExample {
		private Object record;

		public UpdateByExampleParms(Object record, TipoServicioExample example) {
			super(example);
			this.record = record;
		}

		public Object getRecord() {
			return record;
		}
	}

	@Autowired
    public void createSqlMapClient(@Qualifier("sqlMapClient")  SqlMapClient sqlMapClient){
      setSqlMapClient(sqlMapClient);
    }   
}